package com.appwoo.txtws.component;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

public class LoadSoftThread extends Thread
{
  private String apkName;
  private String loadpath;

  public LoadSoftThread(String paramString1, String paramString2)
  {
    this.loadpath = paramString1;
    this.apkName = paramString2;
  }

  protected void downLoadFile()
  {
    File localFile = new File("/mnt/" + this.apkName);
    while (true)
    {
      try
      {
        URL localURL = new URL(this.loadpath);
        try
        {
          HttpURLConnection localHttpURLConnection = (HttpURLConnection)localURL.openConnection();
          InputStream localInputStream = localHttpURLConnection.getInputStream();
          FileOutputStream localFileOutputStream = new FileOutputStream(localFile);
          byte[] arrayOfByte = new byte[localInputStream.available()];
          localHttpURLConnection.connect();
          if (localHttpURLConnection.getResponseCode() >= 400)
          {
            localHttpURLConnection.disconnect();
            localFileOutputStream.close();
            localInputStream.close();
            return;
            if (localInputStream == null)
              continue;
            int i = localInputStream.read(arrayOfByte);
            if (i <= 0)
              continue;
            localFileOutputStream.write(arrayOfByte, 0, i);
          }
        }
        catch (IOException localIOException)
        {
          localIOException.printStackTrace();
          return;
        }
      }
      catch (MalformedURLException localMalformedURLException)
      {
        localMalformedURLException.printStackTrace();
        return;
      }
      if (0.0D <= 100.0D);
    }
  }

  public void run()
  {
    downLoadFile();
    super.run();
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.component.LoadSoftThread
 * JD-Core Version:    0.6.2
 */